﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package eu.orangeflash.webapis.wp {
    import eu.orangeflash.webapis.events.*;
    import eu.orangeflash.webapis.xmlrpc.*;
    import mx.events.*;

    public class WP extends Client implements IClient {

        protected var _password:String;
        protected var _blogID:String;
        protected var _login:String;

        public function WP(){
            super();
        }
        public function getRecentPosts(numberOfPosts:int):WPMethod{
            return ((invoke(Methods.GET_RECENT_POSTS, blogID, login, password, numberOfPosts) as WPMethod));
        }
        private function set _1386162115blogID(value:String):void{
            _blogID = value;
        }
        public function getCategories():WPMethod{
            return ((invoke(Methods.GET_CATEGORY_LIST, blogID, login, password) as WPMethod));
        }
        public function getRecentPostTitles(numberOfPosts:int):WPMethod{
            return ((invoke(Methods.GET_RECENT_POST_TITLES, blogID, login, password, numberOfPosts) as WPMethod));
        }
        public function getPost(postID:String):WPMethod{
            return ((invoke(Methods.GET_POST, postID, login, password) as WPMethod));
        }
        public function get password():String{
            return (_password);
        }
        public function getTrackbackPings(postID:String):WPMethod{
            return ((invoke(Methods.GET_TRACKBACK_PINGS, postID) as WPMethod));
        }
        public function set blogID(value:String):void{
            var oldValue:Object;
            oldValue = this.blogID;
            if (oldValue !== value){
                this._1386162115blogID = value;
                dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "blogID", oldValue, value));
            };
        }
        public function set password(value:String):void{
            var oldValue:Object;
            oldValue = this.password;
            if (oldValue !== value){
                this._1216985755password = value;
                dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "password", oldValue, value));
            };
        }
        public function get blogID():String{
            return (_blogID);
        }
        private function set _1216985755password(value:String):void{
            _password = value;
        }
        public function getPostCategories(postID:String):WPMethod{
            return ((invoke(Methods.GET_POST_CATEGORIES, postID, login, password) as WPMethod));
        }
        public function editPost(postID:String, content:Content, publish:Boolean):WPMethod{
            return ((invoke(Methods.EDIT_POST, postID, login, password, content.rawStruct, publish) as WPMethod));
        }
        override public function get lastResult():Object{
            return (super.lastResult);
        }
        public function newPost(content:Content, publish:Boolean):WPMethod{
            return ((invoke(Methods.NEW_POST, blogID, login, password, content.rawStruct, publish) as WPMethod));
        }
        public function set login(value:String):void{
            var oldValue:Object;
            oldValue = this.login;
            if (oldValue !== value){
                this._103149417login = value;
                dispatchEvent(PropertyChangeEvent.createUpdateEvent(this, "login", oldValue, value));
            };
        }
        private function set _103149417login(value:String):void{
            _login = value;
        }
        public function get login():String{
            return (_login);
        }
        public function deletePost(postID:String, publish:Boolean=true):WPMethod{
            return ((invoke(Methods.DELETE_POST, "", postID, login, password, publish) as WPMethod));
        }
        override public function invoke(methodName:String, ... _args):IMethodCall{
            var result:WPMethod;
            result = new WPMethod(this);
            result.addEventListener(XMLRPCEvent.RESULT, onResult);
            result.addEventListener(XMLRPCEvent.FAULT, onFault);
            result.invoke(methodName, _args);
            return (result);
        }

    }
}//package eu.orangeflash.webapis.wp 
